﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CMSModel
{
    /// <summary>
    /// 文章表
    /// </summary>
    public class Doc
    {
        /// <summary>
        /// 编号
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 内容
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime Pdate { get; set; }
        /// <summary>
        /// 来源网址
        /// </summary>
        public string FromURL { get; set; }
        /// <summary>
        /// 来源网址
        /// </summary>
        public string FromSite { get; set; }
        /// <summary>
        /// 分类
        /// </summary>
        public int CategoryId { get; set; }
        /// <summary>
        /// 分类
        /// </summary>
        public virtual Category Category { get; set; }
        /// <summary>
        /// 阅读次数
        /// </summary>
        public int ReadCount { get; set; }
        /// <summary>
        /// 回复次数
        /// </summary>
        public int ReplyCount { get; set; }
        /// <summary>
        /// 分享次数
        /// </summary>
        public int ShareCount { get; set; }
        /// <summary>
        /// 标题图片
        /// </summary>
        public string Pic { get; set; }
        /// <summary>
        /// 推荐次数
        /// </summary>
        public int RecommendCount { get; set; }
        /// <summary>
        /// 反对次数
        /// </summary>
        public int OppositionCount { get; set; }
        /// <summary>
        /// 发布者编号
        /// </summary>
        public int UserId { get; set; }
        /// <summary>
        /// 发布者
        /// </summary>
        public virtual User User { get; set; }
        /// <summary>
        /// 文章类型 DocType的枚举
        /// </summary>
        public int DocType { get; set; }
        /// <summary>
        /// 权重
        /// </summary>
        public int Weight { get; set; }
        /// <summary>
        /// 专题编号
        /// </summary>
        public int SpecialSubjectId { get; set; }
        /// <summary>
        /// 专题
        /// </summary>
        public virtual SpecialSubject SpecialSubject { get; set; }
        /// <summary>
        /// 摘要
        /// </summary>
        public string Summary { get; set; }

        public Doc()
        {
            this.Id = int.MinValue;
            this.CategoryId = int.MinValue;
            this.DocType = int.MinValue;
            this.OppositionCount = int.MinValue;
            this.ReadCount = int.MinValue;
            this.RecommendCount = int.MinValue;
            this.ReplyCount = int.MinValue;
            this.ShareCount = int.MinValue;
            this.SpecialSubjectId = int.MinValue;
            this.UserId = int.MinValue;
            this.Weight = int.MinValue;
        }
    }
    /// <summary>
    /// 文章类型
    /// </summary>
    public enum DocType
    {
        Normal = 1,
        Pic = 2,
        Voting = 3
    }
}
